<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'MyJsp.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<jsp:include page="/scripts/common/index.html"></jsp:include>
<jsp:include page="/scripts/dhtmlx/index.html"></jsp:include>
<jsp:include page="/scripts/jquery/index.html"></jsp:include>
<jsp:include page="/scripts/bootstrap/index.html"></jsp:include>
<link rel="stylesheet" href="${basepath }style/default.css">
</head>
<script type="text/javascript">
	function save(obj) {
		$.ajax({
				type : 'POST' ,
				url : '${basePath}page/model/WorkFlow/doArchive' ,
				data : {
						"map.taskId" : "${act_form_taskId}" ,
						"map.status" : $("#status").val() ,
						"map.comment" : $("#comment").val() ,
						"map.title" : $("#title").val() ,
						"map.days" : $("#days").val()
				} ,
				dataType : "json" ,
				async : true ,
				cache : false ,
				jsonpCallback : "null" ,
				//beforeSend : function(response, status, statusText) {
				//alert(response + ":" + status + ":" + statusText);
				//} ,
				//dataFilter : function(response, status, statusText) {
				//alert(response + ":" + status + ":" + statusText);
				//} ,
				success : function(response, status, statusText) {
					//alert(response + ":" + status + ":" + statusText);
					if (response.status) {
						if (parent.query) {
							parent.query();
						}
						closeWindow();
					} else {
						alert(response.content);
					}
				} ,
				error : function(response, status, statusText) {
					//alert(response + ":" + status + ":" + statusText);
				} ,
				complete : function(response, status, statusText) {
					//alert(response + ":" + status + ":" + statusText);
				}
		});
	}
	function closeWindow() {
		console.debug(parent.query);
		parent.w1.close();
	}
</script>
<body>
	<form id="MyForm" name="MyForm">
		<table class="contTable">
			<tr class="firstTr">
				<td>
					<jsp:include page="/common/WF_Toolbar_Archive.jsp">
						<jsp:param name="next_func" value="save" />
					</jsp:include>
				</td>
			</tr>
			<tr style="height:auto">
				<td valign="top">
					<div style="width:100%;height:100%;overflow-y:auto;">
						<div class="blockBorder">
							<strong>基本信息</strong>
							<div></div>
							<input id="id" name="map.id" type="hidden" class="form-control" value="${map.id }">
							<div class="blockBorder">
								<strong>基本信息</strong>
								<div></div>
								<input id="guid" name="map.guid" type="hidden" class="form-control" value="${map.guid }">
								ApplyId
								<input id="ApplyId" readonly="readonly" name="map.ApplyId" type="text" class="form-control" value="${map.ApplyId }">
								rootCause:
								<input id="rootCause" name="map.rootCause" type="text" class="form-control" value="${map.rootCause }">
								applytype:
								<select id="applytype" name="map.applytype" type="text" class="form-control">
									<option value="">--请选择--</option>
									<option ${map.applytype eq '事假'?'selected=true':''  }>事假</option>
									<option ${map.applytype eq '年假'?'selected=true':''  }>年假</option>
								</select>
								<!-- 							<input id="applytype" name="map.applytype" type="text" class="form-control" value="${map.applytype }"> -->
								applyer:
								<input id="applyer" readonly="readonly" name="map.applyer" type="text" class="form-control" value="${map.applyer }">
								startTime:
								<input id="startTime" name="map.startTime" type="text" class="form-control Date" value="${map.startTime }">
								endTime:
								<input id="endTime" name="map.endTime" type="text" class="form-control Date" value="${map.endTime }">
								days:
								<input id="days" name="map.days" type="text" class="form-control" value="${map.days }">
							</div>
						</div>
					</div>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
